package com.raysdata.smartcity.dao;

import com.raysdata.smartcity.dto.Attribute;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by bh on 2016/11/8.
 */
@Component
public class CommonDao {

    @Autowired
    private RzBaseDao rzBaseDao;

    public List<Attribute> getAttrListByKey(String key){
        String sql = "SELECT a.attr_id,a.code,a.value FROM ss_attr a " +
                "WHERE a.code LIKE '"+key+"_%' " +
                "AND a.status=1 " +
                "ORDER BY a.sort_no ASC";
        return rzBaseDao.query(sql, Attribute.class);
    }

}
